<template>
	<div class="app-container">
    <el-form :inline="true" :model="dataForm" @submit.native.prevent @keyup.enter.native="getDataList()">
      <el-form-item>
        <el-input placeholder="请验编号" v-model="dataForm.queryCheckId" :clearable="true" type="number" size="mini">
          <template slot="prepend">请验编号</template>
        </el-input>
      </el-form-item>
      <br />
      <el-form-item>
        <el-input placeholder="品名" v-model="dataForm.productName" :clearable="true" size="mini">
          <template slot="prepend">品名</template>
        </el-input>
      </el-form-item>

      <el-form-item>
        <el-input placeholder="GMP编码" v-model="dataForm.productGmp" :clearable="true" size="mini">
          <template slot="prepend">GMP编码</template>
        </el-input>
      </el-form-item>

      <el-form-item>
        <el-input placeholder="物料编码" v-model="dataForm.batchNum" :clearable="true" size="mini">
          <template slot="prepend">物料编码</template>
        </el-input>
      </el-form-item>

      <el-form-item>
        <el-input placeholder="货品规格" v-model="dataForm.productSpec" :clearable="true" size="mini">
          <template slot="prepend">货品规格</template>
        </el-input>
      </el-form-item>

      <el-form-item>
        <el-date-picker
          @change="setGetReportDate"
          v-model="dataForm.getReportDate"
          type="daterange"
          range-separator="~"
          start-placeholder="收到报告时间起"
          end-placeholder="收到报告时间止"
          format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd"
          :picker-options="pickerOptions"
          size="mini"/>
      </el-form-item>

      <el-form-item>
        <el-date-picker
          @change="setReportDate"
          v-model="dataForm.reportDate"
          type="daterange"
          range-separator="~"
          start-placeholder="报告时间起"
          end-placeholder="报告时间止"
          format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd"
          :picker-options="pickerOptions"
          size="mini"/>
      </el-form-item>

<el-form-item>
        <el-date-picker
          @change="setRegistCheckDate"
          v-model="dataForm.registCheckDate"
          type="daterange"
          range-separator="~"
          start-placeholder="请验时间起"
          end-placeholder="请验时间止"
          format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd"
          :picker-options="pickerOptions"
          size="mini"/>
      </el-form-item>
      <el-form-item>
        <el-select v-model="dataForm.status" clearable placeholder="全部状态" size="mini">
          <el-option label="待取样" value="1" />
          <el-option label="待收样" value="2" />
          <el-option label="待分样" value="3" />
          <el-option label="检验中" value="4,5" />
          <el-option label="待结论" value="6" />
          <el-option label="待处理" value="10,7" />
          <el-option label="待收报告" value="10" />
          <el-option label="待放行" value="7" />
          <el-option label="已放行" value="8,11" />
          <el-option label="待确认" value="8" />
          <el-option label="已完成" value="11" />
      	</el-select>
      </el-form-item>

      <el-form-item>
        <el-select v-model="dataForm.passPrintStatus" clearable placeholder="全部打印状态" size="mini">
          <el-option label="待打印" value="1" />
          <el-option label="已打印" value="0" />
      	</el-select>
      </el-form-item>

      <el-form-item v-if="userInfo.types.length != 0">
        <el-select v-model="dataForm.checkTypeId" clearable placeholder="全部分类" size="mini">
          <el-option
            v-for="t in userInfo.types"
            :key="t.checkTypeId"
            :label="t.checkTypeName"
            :value="t.checkTypeId">
          </el-option>
      	</el-select>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" class="pan-btn primary-btn" @click="searchData()" icon="el-icon-search" size="mini">搜索</el-button>
      </el-form-item>

      <el-form-item>
        <el-button type="success" class="pan-btn success-btn" @click="mprint()" :disabled="selectionList.length == 0" size="mini">批量打印审核单</el-button>
      </el-form-item>

<!--      <el-form-item>
        <el-button type="success" class="pan-btn success-btn" @click="mbatch()" :disabled="selectionList.length == 0" size="mini">批量打印批封面</el-button>
      </el-form-item> -->

      <el-form-item>
        <el-button type="success" class="pan-btn success-btn" @click="pCert()" :disabled="selectionList.length == 0" size="mini">批量打印合格证</el-button>
      </el-form-item>

      <el-form-item>
        <el-button type="danger" class="pan-btn danger-btn" @click="noPCert()" :disabled="selectionList.length == 0" size="mini">批量打印不合格证</el-button>
      </el-form-item>

      <el-form-item>
        <el-checkbox v-model="dataForm.showBinding">搜索绑定的中间产品</el-checkbox>
      </el-form-item>
    </el-form>

    <el-table
    	:data="dataList"
    	v-loading="dataListLoading"
      @selection-change="selectionChange"
      ref="dataTable"
    	border
      fit
      highlight-current-row
      style="width: 100%">
      <el-table-column
        type="selection"
        header-align="center"
        align="center"
        width="50">
      </el-table-column>
      <el-table-column
        prop="checkId"
        header-align="center"
        align="center"
        label="编号"
        width="80">
      </el-table-column>
      <el-table-column
      	prop="status"
      	header-align="center"
      	align="center"
      	label="状态"
        width="80">
        <template slot-scope="{row}">
          <el-tag :type="row.status < 7 ? 'primary' : row.status == 10 ? 'danger' : row.status == 7 ? 'warning' : 'success'" size="small">
            {{ row.status | statusFilter }}
          </el-tag>
        </template>
      </el-table-column>
      dataForm.passPrintStatus
      <el-table-column
      	prop="status"
      	header-align="center"
      	align="center"
      	label="打印"
        width="80">
        <template slot-scope="{row}">
          <el-tag :type="row.passPrintStatus == 0 ? 'success' : 'warning'" size="small">
            {{ row.passPrintStatus == 0 ? '已打印' : '待打印' }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column
        prop="checkTypeName"
        header-align="center"
        align="center"
        label="分类"
        width="80">
      </el-table-column>
      <el-table-column
        prop="productName"
        header-align="center"
        align="center"
        label="品名">
      </el-table-column>
      <el-table-column
        prop="batchNumPrefix"
        header-align="center"
        align="center"
        label="物料编码">
      </el-table-column>
      <el-table-column
        prop="productSpec"
        header-align="center"
        align="center"
        label="货品规格">
        <template slot-scope="{row}">
          <span v-html="row.productSpec"></span>
        </template>
      </el-table-column>
      <el-table-column
        prop="registCheckDepartmentName"
        header-align="center"
        align="center"
        label="请验部门"
        width="80">
      </el-table-column>
      <el-table-column
        prop="registCheckUserName"
        header-align="center"
        align="center"
        label="请验人"
        width="70">
      </el-table-column>
      <el-table-column
        prop="registCheckDate"
        header-align="center"
        align="center"
        label="请验时间">
        <template slot-scope="{row}">{{row.registCheckDate | changeTime}}</template>
      </el-table-column>
      <el-table-column
        prop="reportGetDate"
        header-align="center"
        align="center"
        label="收到报告时间">
        <template slot-scope="{row}">{{row.reportGetDate | changeTime}}</template>
      </el-table-column>
      <el-table-column
        prop="passDate"
        header-align="center"
        align="center"
        label="放行时间">
        <template slot-scope="{row}">{{row.passDate | changeTime}}</template>
      </el-table-column>
      <el-table-column
        prop="allProcedureNames"
        header-align="center"
        align="center"
        label="所有工序">
        <template slot-scope="{row}">
          <span style="color: #67C23A;">{{ row.finishProcedureNames | procedureNameFilter }}</span>
          <span style="color: #F56C6C;">{{ row.waitProcedureNames | procedureNameFilter }}</span>
        </template>
      </el-table-column>
      <el-table-column
        v-if="dataForm.showBinding"
        prop="binds"
        header-align="center"
        align="center"
        label="中间品">
        <template slot-scope="{row}">
          <template v-if="row.bindingZp == 0">
            <template v-if="row.binds == null">
              <span style="color: red">未发起</span>
            </template>
            <template v-else>
              <span v-for="cl in row.binds" :key="cl.checkId">
                <el-button plain size="mini" @click="show(cl.checkTypeId,cl.productGmp,cl.batchNum)">{{ cl.productGmp }}</el-button>
              </span>
            </template>
          </template>
          <template v-else>
            未绑定
          </template>
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        align="center"
        label="操作"
        width="190">
        <template slot-scope="scope">
          <el-button type="success" class="pan-btn success-btn" size="mini" v-if="(scope.row.status == 8 || scope.row.status == 11) && scope.row.reportDate != null" @click="pass(scope.row)">修改</el-button>
          <el-button type="warning" class="pan-btn warning-btn" size="mini" v-if="scope.row.status == 7 && scope.row.reportDate != null" @click="pass(scope.row)">放行</el-button>
          <el-button type="danger" class="pan-btn danger-btn" v-if="scope.row.status == 10 && scope.row.reportDate != null" size="mini" @click="get(scope.row)">收到</el-button>
          <el-button type="success" class="pan-btn success-btn" v-if="scope.row.status > 6 && scope.row.checkTypeId" size="mini" @click="print(scope.row)">打印审核单</el-button>
<!--          <el-button type="success" class="pan-btn success-btn" v-if="scope.row.status > 7 && scope.row.checkTypeId == 5" size="mini" @click="mbatch(scope.row)">打印批封面</el-button> -->
          <el-button type="success" class="pan-btn success-btn" v-if="printCertification(scope.row)" size="mini" @click="pCert(scope.row)">打印合格证</el-button>
          <el-button type="danger" class="pan-btn danger-btn" v-if="printCertification(scope.row)" size="mini" @click="noPCert(scope.row)">打印不合格证</el-button>
        </template>
      </el-table-column>
      <el-table-column
        header-align="center"
        align="center"
        label="详情"
        width="100">
        <template slot-scope="scope">
          <el-button type="info" class="pan-btn info-btn" size="mini" @click="info(scope.row)">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper"
    ></el-pagination>

    <check-info
      v-if="infoVisible"
      @close="close('infoVisible')"
      @refreshData="getDataList"
      :childDataForm="childDataForm" />

    <check-info-merge
      v-if="infoMergeVisible"
      @close="close('infoMergeVisible')"
      @refreshData="getDataList"
      :childDataForm="childDataForm" />

    <pass
      v-if="passVisible"
      @close="close('passVisible')"
      @refreshData="getDataList"
      :childDataForm="childDataForm" />

    <print
      v-if="printVisible"
      @close="close('printVisible')"
      :childDataForm="childDataForm" />

    <mprint
      v-if="mprintVisible"
      @close="close('mprintVisible')"
      :childDataForm="childDataForm" />

    <mbatch
      v-if="mbatchVisible"
      @close="close('mbatchVisible')"
      :childDataForm="childDataForm" />

	</div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import CommonMethod from '@/views/mixin/common'
  import { CODE_OK } from '@/common/js/config'
  import { checkList,reportGet,getVersion,setPassPrintStatus,updateCheckListsPrintPassNumberForCurrent } from '@/api/check'
  import { isBlank,parseTime } from '@/common/js/utils'
  import CheckInfo from '@/views/modules/process/common/check-info'
  import CheckInfoMerge from '@/views/modules/process/common/check-info-merge'
  import Pass from '@/views/modules/process/pass/pass'
  import Print from '@/views/modules/printmodel/printchoice'
  import Mprint from '@/views/modules/print/mprint'
  import Mbatch from '@/views/modules/print/mbatch'
	export default {
    name: 'fangxing',
    filters: {
      procedureNameFilter(name) {
        if (!isBlank(name)) {
          return name.replace(',',' ')
        }
        return null
      },
      statusFilter(status) {
        const statusMap = {
          0: '待处理',
          1: '待取样',
          2: '待收样',
          3: '待分发',
          4: '检验中',
          5: '检验中',
          6: '待结论',
          10: '待收报告',
          7: '待放行',
          8: '待确认',
          11: '已完成',
          9: '已作废'
        }
        return statusMap[status]
      }
    },
    mixins: [CommonMethod],
    components: {
    	CheckInfo,CheckInfoMerge,Pass,Print,Mprint,Mbatch
    },
		data(){
      return{
        currentStatus: 7,
        dataList: [],
        pageIndex: 1,
        pageSize: 10,
        totalPage: 0,
        dataListLoading: false,
        dataForm: {
          getReportDate: null,
          getReportDateStart: null,
          getReportDateEnd: null,
          reportDate: null,
          reportDateStart: null,
          reportDateEnd: null,
          status: '10,7',
          passPrintStatus: null,
          showBinding: false
        },
        childDataForm: '',
        infoVisible: false,
        infoMergeVisible: false,
        passVisible: false,
        printClassify: '物料放行审核单',
        printVisible: false,
        mprintVisible: false,
        mbatchVisible: false,
        selectionList: []
      }
		},
    mounted() {
      this.getInfo()
    },
    computed: {
      ...mapGetters([
         'userInfo'
      ])
    },
		methods:{
      printCertification(row) {
        return row.status > 7
        && (row.checkTypeId == 1 || row.checkTypeId == 2 || row.checkTypeId == 3 || row.checkTypeId == 9)
      },
      noPCert(l) {
        let list = l ? [l] : JSON.parse(JSON.stringify(this.selectionList))
        list = list.filter(v => v.status > 7 && (v.checkTypeId == 1 || v.checkTypeId == 2 || v.checkTypeId == 3 || v.checkTypeId == 5 || v.checkTypeId == 9))
        if (list.length == 0) {
          this.$message.error("所选列表中没有可打印的不合格证，请重新选择")
          return
        }
        // list 按 批号 晚->早 排序
        list = list.sort((a, b) => {
          return a.batchNumPrefix.replace(/[^\d]/g,"") - b.batchNumPrefix.replace(/[^\d]/g,"")
        })
        this.childDataForm = {
          printClassify: '不合格证',
          printPassVersion: '01',
          list: list
        }
        this.mprintVisible = true
      },
      pCert(l) {
        let list = l ? [l] : JSON.parse(JSON.stringify(this.selectionList))
        list = list.filter(v => v.status > 7 && (v.checkTypeId == 1 || v.checkTypeId == 2 || v.checkTypeId == 3 || v.checkTypeId == 5 || v.checkTypeId == 9))
        if (list.length == 0) {
          this.$message.error("所选列表中没有可打印的合格证，请重新选择")
          return
        }
        // list 按 批号 晚->早 排序
        list = list.sort((a, b) => {
          return a.batchNumPrefix.replace(/[^\d]/g,"") - b.batchNumPrefix.replace(/[^\d]/g,"")
        })
        this.childDataForm = {
          printClassify: '合格证',
          printPassVersion: '01',
          list: list
        }
        this.mprintVisible = true
      },
      mbatch(l) {
        let list = l ? [l] : JSON.parse(JSON.stringify(this.selectionList))
        list = list.filter(v => v.status > 7 && v.checkTypeId == 5)
        if (list.length == 0) {
          this.$message.error("所选列表中没有放行过的成品，请重新选择")
          return
        }
        // list 按 批号 晚->早 排序
        list = list.sort((a, b) => {
          return a.batchNumPrefix.replace(/[^\d]/g,"") - b.batchNumPrefix.replace(/[^\d]/g,"")
        })
        // 添加状态
        setPassPrintStatus(list.map(v => {return v.checkMergeId})).then(res => {
          if (res.code === CODE_OK) {
            this.childDataForm = {
              list: list
            }
            this.mbatchVisible = true
          }else{
            this.$message.error(res.msg)
          }
        })
      },
      mprint() {
        let temp = JSON.parse(JSON.stringify(this.selectionList))
        let list = []
        let filter = false
        for (let cl of temp) {
          if (cl.status <= 6 || cl.checkTypeId == 5) {
            filter = true
          }else{
            list.push(cl)
          }
        }
        if (isBlank(list)) {
          this.$message.error("所选列表中无已经打印过报告或全是成品，请重新选择")
          return
        }
        if (filter) {
          this.$message.error("所选列表中含有未打印报告的或者成品，已为您自动过滤")
        }
        // list 按 出报告日期 晚->早 排序
        list = list.sort((a, b) => {
          return new Date(b.reportDate).getTime() - new Date(a.reportDate).getTime()
        })
        // list 按 请验日期 晚->早 排序
       list = list.sort((a, b) => {
          return new Date(b.registCheckDate).getTime() - new Date(a.registCheckDate).getTime()
       })
        // 初始化所需参数
        const params = {
          checkTypeId: list[0].checkTypeId,
          printClassify: this.printClassify
        }
        getVersion(params).then(res => {
          if (res.code === CODE_OK) {
            let version = res.list.find((l) => (l.isCurrent == 0))
            if (isBlank(version)) {
              this.$message.error('暂无此类别的打印单,请联系管理员检查')
              return
            }
            // 如果有已经打印的旧版本审核单，那么提示用户将其覆盖为最近版
            let printPassNumber = version.recordNum + '-' + version.versionNum
            if (list.findIndex(v => v.passPrintStatus == 0 && v.printPassNumber != printPassNumber) > -1) {
              this.$confirm('所选列表含有已经打印过的旧版本，是否将其再次打印为当前版本，否则只打印未打印过的?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(async () => {
                let ids = list.map(v => {return v.checkMergeId})
                // 此打印为物料放行审核单，反写记录编号到check_list
                const data = {
                  checkMergeIds: ids.join(','),
                  checkVersionId: version.checkVersionId
                }
                updateCheckListsPrintPassNumberForCurrent(data).then(res => {
                  if (res.code === CODE_OK) {
                    // 再添加状态
                    printPassNumber = res.printPassNumber
                    setPassPrintStatus(list.map(v => {return v.checkMergeId})).then(res => {
                      if (res.code === CODE_OK) {
                        this.childDataForm = {
                          printNumber: printPassNumber,
                          list: list.map(cl => {
                            this.$set(cl, 'printNumber', printPassNumber)
                            return cl
                          })
                        }
                        this.mprintVisible = true
                      }else{
                        this.$message.error(res.msg)
                      }
                    })
                  }else{
                    this.$message.error(res.msg)
                  }
                })
              }).catch(async () => {
                list = list.filter(v => !(v.passPrintStatus == 0 && v.printPassNumber != printPassNumber))
                this.childDataForm = {
                  printNumber: printPassNumber,
                  list: list.map(cl => {
                    this.$set(cl, 'printNumber', printPassNumber)
                    return cl
                  })
                }
                this.mprintVisible = true
              })
            }else{
              let ids = list.map(v => {return v.checkMergeId})
              // 此打印为物料放行审核单，反写记录编号到check_list
              const data = {
                checkMergeIds: ids.join(','),
                checkVersionId: version.checkVersionId
              }
              updateCheckListsPrintPassNumberForCurrent(data).then(res => {
                if (res.code === CODE_OK) {
                  // 再添加状态
                  printPassNumber = res.printPassNumber
                  setPassPrintStatus(list.map(v => {return v.checkMergeId})).then(res => {
                    if (res.code === CODE_OK) {
                      this.childDataForm = {
                        printNumber: printPassNumber,
                        list: list.map(cl => {
                          this.$set(cl, 'printNumber', printPassNumber)
                          return cl
                        })
                      }
                      this.mprintVisible = true
                    }else{
                      this.$message.error(res.msg)
                    }
                  })
                }else{
                  this.$message.error(res.msg)
                }
              })
            }
          }else{
            this.$message.error(res.msg)
          }
        })
      },
      print(row) {
        this.childDataForm = JSON.parse(JSON.stringify(row))
        this.$set(this.childDataForm, 'printNumber', row.printPassNumber)
        this.$set(this.childDataForm, 'printClassify', this.printClassify)
        this.$set(this.childDataForm, 'printType', '放行审核单')
        this.printVisible = true
        // 如果已经打印过，那么直接将记录编号拿过去放出来
        // if (!isBlank(row.printPassNumber)) {
        //   this.childDataForm = JSON.parse(JSON.stringify(row))
        //   this.$set(this.childDataForm, 'printNumber', row.printPassNumber)
        //   this.$set(this.childDataForm, 'printClassify', this.printClassify)
        //   this.$set(this.childDataForm, 'printType', '放行审核单')
        //   this.printVisible = true
        // }else{
        //   const params = {
        //     checkTypeId: row.checkTypeId,
        //     printClassify: this.printClassify
        //   }
        //   getVersion(params).then(res => {
        //     if (res.code === CODE_OK) {
        //       let v = res.list.find((l) => (l.isCurrent == 0))
        //       if (isBlank(v)) {
        //         this.$message.error('暂无此类别的打印单,请联系管理员检查')
        //         return
        //       }
        //       // 此打印为物料放行审核单，反写记录编号到check_list
        //       const data = {
        //         checkMergeId: row.checkMergeId,
        //         checkVersionId: v.checkVersionId
        //       }
        //       updateCheckListsPrintPassNumberForCurrent(data).then(res => {
        //         if (res.code === CODE_OK) {
        //           // 再添加状态
        //           let printPassNumber = res.printPassNumber
        //           setPassPrintStatus([row.checkMergeId]).then(res => {
        //             if (res.code === CODE_OK) {
        //               this.childDataForm = JSON.parse(JSON.stringify(row))
        //               this.$set(this.childDataForm, 'printNumber', printPassNumber)
        //               this.$set(this.childDataForm, 'printClassify', this.printClassify)
        //               this.printVisible = true
        //             }else{
        //               this.$message.error(res.msg)
        //             }
        //           })
        //         }else{
        //           this.$message.error(res.msg)
        //         }
        //       })
        //     }else{
        //       this.$message.error(res.msg)
        //     }
        //   })
        // }
      },
      get(row) {
        this.$confirm('确认收到报告书?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let data = row
          data.getUserId = this.userInfo.userId
          data.getUserName = this.userInfo.name
          data.getDate = parseTime(new Date())
          reportGet(data).then(res => {
            if (res.code === CODE_OK) {
              this.$message.success('提交成功')
              this.getDataList()
            }else{
              this.$message.error(res.msg)
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
      },
      pass(row) {
        this.childDataForm = JSON.parse(JSON.stringify(row))
        this.passVisible = !this.passVisible
      },
      searchData() {
      	this.pageIndex=1
      	this.getDataList()
      },
      getInfo() {
        this.getDataList()
      },
      getDataList() {
      	this.dataListLoading = true
        const params = {
          page: this.pageIndex,
          limit: this.pageSize,
          status: this.dataForm.status || '1,2,3,4,5,6,10,7,8,11',
          passPrintStatus: this.dataForm.passPrintStatus || null,
          isMerge: 0,
          checkTypeId: this.dataForm.checkTypeId || this.userInfo.types.map(t => {return t.checkTypeId}).join(','),
          productName: this.dataForm.productName || null,
          productGmp: this.dataForm.productGmp || null,
          batchNum: this.dataForm.batchNum || null,
          productSpec: this.dataForm.productSpec || null,
          getReportDateStart: this.dataForm.getReportDateStart || null,
          getReportDateEnd: this.dataForm.getReportDateEnd || null,
          reportDateStart: this.dataForm.reportDateStart || null,
          reportDateEnd: this.dataForm.reportDateEnd || null,
          startTime: this.dataForm.startTime || '2021-04-21',
		      endTime: this.dataForm.endTime || null,
          showBinding: this.dataForm.showBinding || null,
          isPass: 0,
          checkId: this.dataForm.queryCheckId || null
        }
        checkList(params).then(res => {
        	if (res.code === CODE_OK) {
        		this.dataList = res.page.list
        		this.totalPage = res.page.totalCount
        	}else{
        		this.$message.error(res.msg)
        	}
        	this.dataListLoading = false
        }).catch()
      },
      info(row) {
        this.childDataForm = {
          currentStatus: this.currentStatus,
          info: row
        }
        if (row.isMerge == 0) {
          this.infoMergeVisible = !this.infoMergeVisible
        }else{
          this.infoVisible = !this.infoVisible
        }
      },
      close(val) {
        this.getDataList()
        this.childDataForm = ''
        this[val] = !this[val]
      },
      setGetReportDate() {
        if (!isBlank(this.dataForm.getReportDate)) {
          this.dataForm.getReportDateStart = this.dataForm.getReportDate[0]
          this.dataForm.getReportDateEnd = this.dataForm.getReportDate[1]
        }else{
          this.dataForm.getReportDateStart = null
          this.dataForm.getReportDateEnd = null
        }
      },
      setReportDate() {
        if (!isBlank(this.dataForm.reportDate)) {
          this.dataForm.reportDateStart = this.dataForm.reportDate[0]
          this.dataForm.reportDateEnd = this.dataForm.reportDate[1]
        }else{
          this.dataForm.reportDateStart = null
          this.dataForm.reportDateEnd = null
        }
      },
      setRegistCheckDate() {
        if (!isBlank(this.dataForm.registCheckDate)) {
          this.dataForm.startTime = this.dataForm.registCheckDate[0]
          this.dataForm.endTime = this.dataForm.registCheckDate[1]
        }else{
          // this.dataForm.registCheckDateStart = null
          // this.dataForm.registCheckDateEnd = null
          this.dataForm.startTime = '2021-01-01'
          //'2021 年 01 月 01 日'
          this.dataForm.endTime = null
        }
      },
      show(checkTypeId, productGmp, batchNumPrefix) {
        this.$router.push({
          name: '检验进度查询',
          params: {
            serachInfo: {
              checkTypeId: checkTypeId,
              productGmp: productGmp,
              batchNum: batchNumPrefix
            }
          }
        })
      },
      selectionChange(obj) {
      	this.selectionList = obj
      }
		}
	}
</script>

<style scoped>
  >>> .el-form-item__content {
    line-height: normal;
  }
</style>
